import { createRouter, createWebHistory } from 'vue-router'
import RootView from '../views/RootView/index.vue'
import BaseView from '../views/BaseView/index.vue'
import Container from '../views/Container/index.vue'
import BasePage1 from '../views/BasePage1/index.vue'
import BasePage2 from '../views/BasePage2/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'root',
      component: RootView,
      redirect: '/base',
      children: [
        {
          path: 'base',
          name: 'base',
          component: BaseView,
          redirect: '/base/basePage1',
          children: [
            {
              path: 'basePage1',
              name: 'basePage1',
              component: BasePage1
            },
            {
              path: 'basePage2',
              name: 'basePage2',
              component: BasePage2
            }
          ]
        },
        {
          path: '/child/vue1',
          name: 'vue1',
          component: Container,
          redirect: '/child/vue1/vue1Page1',
          children: [
            {
              path: 'vue1Page1',
              name: 'vue1Page1',
              component: Container
            },
            {
              path: 'vue1Page2',
              name: 'vue1Page2',
              component: Container
            }
          ]
        },
        {
          path: '/child/vue2',
          name: 'vue2',
          component: Container
        },
     ]
    }
  ],
})

export default router
